import java.util.ArrayList;
import java.util.List;


public class College {
    // 聚合：College包含Building对象的聚合
    private List<Building> buildings;
    // 组合：College包含Course对象的组合
    private List<Course> courses;

    public College() {
        this.buildings = new ArrayList<>();
        this.courses = new ArrayList<>();
    }

    // 添加建筑
    public void addBuilding(Building building) {
        buildings.add(building);
    }

    // 移除建筑
    public void removeBuilding(Building building) {
        buildings.remove(building);
    }

    // 添加课程
    public void addCourse(Course course) {
        courses.add(course);
    }

    // 移除课程
    public void removeCourse(Course course) {
        courses.remove(course);
    }

    // 获取建筑列表
    public List<Building> getBuildings() {
        return buildings;
    }

    // 获取课程列表
    public List<Course> getCourses() {
        return courses;
    }
}

// Building类
 class Building {
    private String name;
    private String location;

    public Building(String name, String location) {
        this.name = name;
        this.location = location;
    }

    // 获取建筑的详细信息
    public String getDetails() {
        return "Building Name: " + name + ", Location: " + location;
    }

    // Getter和Setter方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }
}

// Course类
class Course {
    private String title;
    private int credits;
    private Building building; // Course一定在某个Building中进行

    public Course(String title, int credits, Building building) {
        this.title = title;
        this.credits = credits;
        this.building = building;
    }

    // 获取课程的详细信息
    public String getDetails() {
        return "Course Title: " + title + ", Credits: " + credits + ", Conducted in: " + building.getName();
    }

    // Getter和Setter方法
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getCredits() {
        return credits;
    }

    public void setCredits(int credits) {
        this.credits = credits;
    }

    public Building getBuilding() {
        return building;
    }

    public void setBuilding(Building building) {
        this.building = building;
    }
}
